<#assign pageTitle = "我的笔记" />
<#assign pageHeader>
    <script type="text/javascript" src="/static/libs/swiper/swiper-bundle.min.js"></script>
</#assign>
<#assign pageContent>
    <article class="w80 fl">
        <div class="u-r-cont">
            <section>
                <div class="">
                    <section class="u-r-tit-all">
                        <h2 class="clearfix">
                            <span class="unFw current">我的笔记</span>
                        </h2>
                    </section>
                    <div class="">
                        <section class="no-data-wrap" <#if (courseNoteList?size>0)>style="display: none" </#if>>
                            <em class="icon30 no-data-ico">&nbsp;</em> <span class="c-666 fsize14 ml10 vam">还没有任何笔记！~<a href="/user/index.html" class="c-master">马上去学习</a></span>
                        </section>
                        <section class="u-all-bj-list">
                            <ul>
                                <#list courseNoteList as courseNote>
                                    <li>
                                        <div class="u-bj-warp">
                                            <span class="bj-ico">&nbsp;</span>
                                            <div class="u-bj-time">
                                                <p class="hLh30 f-fM c-666 fsize16 tac">
                                                    ${courseNote.updateTime?string("yyyy-MM-dd")}
                                                </p>
                                            </div>
                                            <div class="u-bj-item">
                                                <div class="u-bj-it-time">
                                                <span class="pc-time">
                                                   ${courseNote.updateTime?string("HH:mm:ss")}
                                                </span>
                                                    <span class="mobil-time">
                                                    ${courseNote.updateTime?string("yyyy-MM-dd HH:mm:ss")}
                                                </span>
                                                </div>
                                                <section class="u-bj-i-txt mt10">
                                                    <p class="c-333 fsize14">
                                                        <tt class="c-master vam f-fM">笔记内容：</tt>
                                                        <tt class="vam f-fM">${courseNote.content}</tt>
                                                    </p>
                                                </section>
                                                <section class="u-bj-b-warp mt20">
                                                    <div class="clearfix">
                                                        <div class="box-bj">
                                                            <p class="hLh30 fsize14 c-999 f-fM txtOf l-box-bj">
                                                                <tt class="c-999 fsize14 f-fM vam">课程：</tt>
                                                                <a href="/user/course/info.html?id=${courseNote.courseId}" class="c-333 fsize14 f-fM vam">${courseNote.courseName!}</a>
                                                            </p>
                                                        </div>
                                                        <div class="box-bj">
                                                            <p class="hLh30 fsize14 c-999 f-fM txtOf l-box-bj">
                                                                <tt class="c-999 fsize14 f-fM vam">章节：</tt>
                                                                <a href="/user/course/play.html?nodeId=${courseNote.nodeId}" class="c-333 fsize14 f-fM vam">${courseNote.nodeName!}</a>
                                                            </p>
                                                        </div>
                                                        <div class="tar u-o-right box-bj">
                                                            <a class="cou-kscp mr20" target="_blank" title="编辑笔记" href="/user/course/play.html?nodeId=${courseNote.nodeId}?isCourseNote=1">编辑笔记</a>
                                                            <a class="cou-kscp gmkc" href="javascript:void(0)" onclick="delConfirm('${courseNote.id}',this)">删除笔记</a>
                                                        </div>
                                                    </div>
                                                </section>
                                            </div>
                                        </div>
                                    </li>
                                </#list>
                            </ul>
                        </section>
                        <!-- 公共分页 开始 -->
                        <div class="paging" id="showPages"></div>
                        <!-- 公共分页 结束 -->
                    </div>
                </div>
            </section>
        </div>
    </article>
</#assign>
<#assign pageFooter>
    <script type="text/javascript" src="/static/js/page.js"></script>
    <script type="text/javascript">
        var options = {
            currentPage : ${page.currentPage}
            ,totalPage : ${totalPages}
        };
        $(function () {
            showPages(options);
        });

        function delConfirm(id) {
           return layer.confirm("确认要删除这个笔记吗？", {
                icon: 3,
                title: "系统提示",
                btn: ['确认', '取消']
            }, function (index) {
                layer.close(index);
                $.ajax({
                    url: '/user/course/note/delete.json',
                    type: 'post',
                    data: {"id": id},
                    dataType: 'json',
                    success: function (result) {
                        if (result.code === 0) {
                            location.reload();
                        } else {
                            layer.msg(result.msg);
                        }
                    }
                });
            });
        }
    </script>
</#assign>
<#include "../layouts/layout_uc.ftl">
